import request from '@/router/axios';

/** @desc 政策列表 */
export const getList = (current, size, params) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}

/** @desc 政策详情 */
export const getDetail = (id) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/detail',
    method: 'get',
    params: {id}
  })
}

/** @desc 新增或修改 */
export const apiSubmit = (row) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/submit',
    method: 'post',
    headers: {
      "Content-Type": "application/json; charset=UTF-8",
    },
    data: JSON.stringify(row)
  })
}

/** @desc 删除 */
export const apiDel = (id) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/remove',
    method: 'post',
    params: {
      id
    }
  })
}

/** @desc 白名单服务商列表 */
export const getServiceList = (row) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/serviceList',
    method: 'post',
    headers: {
      "Content-Type": "application/json; charset=UTF-8",
    },
    data: JSON.stringify(row)
  })
}

/** @desc 白名单商户列表 */
export const getMerchantList = (row) => {
  return request({
    url: '/api/rb-oem/oem/optimizeTrade/optimize_trade/merchantList',
    method: 'post',
    headers: {
      "Content-Type": "application/json; charset=UTF-8",
    },
    data: JSON.stringify(row)
    
  })
}